package com.xiaohudie.JUC;

/**
 * @Author xiao hu die
 * @Date 2022/1/13 22:26
 * @Version 1.0
 */

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**演示hasmap*/
public class Thread07 {
    public static void main(String[] args) {
    //     Map<String,String> stringStringMap =new HashMap<>();
      Map<String,String> stringStringMap =new ConcurrentHashMap<>();
        for (int i = 0; i < 20; i++) {
            String key =String.valueOf(i);
            new Thread(()->{
                stringStringMap.put(key, UUID.randomUUID().toString());
                System.out.println(stringStringMap);

            },String.valueOf(i)).start();
        }
    }
}
